; ADD SPECIALS To the program.

#include <GUIConstantsEx.au3>
;#include <Cutlass.au3>
;#include <Gun.au3>
;#include <Doll.au3>
;#include <Dagger.au3>
;#include <Grenade.au3>
;#include <Staff.au3>
#include <General.au3>
#include <Exit.au3>
#include <Update.au3>

HotKeySet("{F1}", "cutlass")
HotKeySet("{F2}", "gun")
HotKeySet("{F3}", "doll")
HotKeySet("{F4}", "dagger")
HotKeySet("{F5}", "grenade")
HotKeySet("{ENTER}", "TogglePause")

Global $Paused
$activeWeapon = 0

;cutlass timers
$beginSweep = 0
$beginBrawl = 0
$beginTaunt = 0
$beginStorm = 0

;dagger timers
$beginAsp = 0
$beginAdder = 0
$beginDirt = 0
$beginSidewinder = 0
$beginNest = 0

$cutlassinfo = IniReadSection("attackhack.ini", "cutlass" )
$dollinfo = IniReadSection("attackhack.ini", "doll" )
$daggerinfo = IniReadSection("attackhack.ini", "dagger" )
$guninfo = IniReadSection("attackhack.ini", "gun" )
$staffinfo = IniReadSection("attackhack.ini", "staff" )
$grenadeinfo = IniReadSection("attackhack.ini", "grenade" )
$healthinfo = IniReadSection("attackhack.ini", "health")

Opt("GUIOnEventMode",1)

GUICreate("Attack Hack", 414, 400)

;Menu
$filemenu = GuiCtrlCreateMenu ("Options")
$generalitem = GuiCtrlCreateMenuitem ("General",$filemenu)
$separator1 = GuiCtrlCreateMenuitem ("",$filemenu)
$exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu)
$helpmenu = GuiCtrlCreateMenu ("?")
$aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu)

; TAB
GuiCtrlCreateTab(0, 0, 415, 380)
$cutlasstab = GuiCtrlCreateTabItem("Saber")

;Combo Menu
GUICtrlCreateGroup("Combo Menu", 5, 40, 200, 125)

;Combo 1
$Cutlass_Label_1 = GuiCtrlCreateLabel("Combo 1", 40, 60, 80, 21)
$Cutlass_Combo_1 = GuiCtrlCreateInput($cutlassinfo[3][1], 130, 60, 50, 20)
$Cutlass_Combo1 = GUICtrlCreateRadio("", 20, 60, 10, 20)

;Combo 2
$Cutlass_Label_2 = GuiCtrlCreateLabel( "Combo 2", 40, 80, 80, 21)
$Cutlass_Combo_2 = GuiCtrlCreateInput(Sqrt($cutlassinfo[4][1]*$cutlassinfo[4][1]), 130, 80, 50, 20)
$Cutlass_Combo2 = GUICtrlCreateRadio("", 20, 80, 10, 20)

;Combo 3
$Cutlass_Label_3 = GuiCtrlCreateLabel( "Combo 3", 40, 100, 80, 21)
$Cutlass_Combo_3 = GuiCtrlCreateInput(Sqrt($cutlassinfo[5][1]*$cutlassinfo[5][1]), 130, 100, 50, 20)
$Cutlass_Combo3 = GUICtrlCreateRadio("", 20, 100, 10, 20)

;Combo 4
$Cutlass_Label_4 = GuiCtrlCreateLabel( "Combo 4", 40, 120, 80, 21)
$Cutlass_Combo_4 = GuiCtrlCreateInput(Sqrt($cutlassinfo[6][1]*$cutlassinfo[6][1]), 130, 120, 50, 20)
$Cutlass_Combo4 = GUICtrlCreateRadio("", 20, 120, 10, 20)

;Combo 5
$Cutlass_Label_5 = GuiCtrlCreateLabel( "Combo 5", 40, 140, 80, 21)
$Cutlass_Combo_5 = GuiCtrlCreateInput(Sqrt($cutlassinfo[7][1]*$cutlassinfo[7][1]), 130, 140, 50, 20)
$Cutlass_Combo5 = GUICtrlCreateRadio("", 20, 140, 10, 20)

GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group



;Special Group
GUICtrlCreateGroup("Specials to use", 5, 180, 150, 125)
;Sweep
$Cutlass_Label_7 = GuiCtrlCreateLabel( "Sweep", 30, 200, 100, 21)
$Cutlass_Special_2 = GuiCtrlCreateCheckbox("", 10, 200, 10, 20)

;Brawl
$Cutlass_Label_8 = GuiCtrlCreateLabel( "Brawl", 30, 220, 90, 21)
$Cutlass_Special_3 = GuiCtrlCreateCheckbox("", 10, 220, 10, 20)

;Taunt
$Cutlass_Label_9 = GuiCtrlCreateLabel( "Taunt", 30, 240, 90, 21)
$Cutlass_Special_4 = GuiCtrlCreateCheckbox("", 10, 240, 10, 20)

;Storm
$Cutlass_Label_10 = GuiCtrlCreateLabel( "Storm", 30, 260, 90, 21)
$Cutlass_Special_5 = GuiCtrlCreateCheckbox("", 10, 260, 10, 20)

;Special Delay
$Cutlass_Label_6 = GuiCtrlCreateLabel( "Special Delay", 30, 280, 90, 21)
$Cutlass_Special1  = GuiCtrlCreateInput(Sqrt($cutlassinfo[2][1]*$cutlassinfo[2][1]) , 120, 280, 33, 20)
$Cutlass_Special_1 = GuiCtrlCreateCheckbox("", 10, 280, 10, 20)


GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group


$Cutlass_Button_1 = GuiCtrlCreateButton("Update", 170, 330, 60, 20)




$guntab = GuiCtrlCreateTabItem("Gun")

;Shot Menu
GUICtrlCreateGroup("Shot Menu", 5, 40, 150, 145)

;Normal Shot
$Gun_Label_1 = GuiCtrlCreateLabel( "Normal Shot", 30, 60, 100, 21)
$Gun_Shot_1 = GUICtrlCreateRadio("", 10, 60, 10, 20)

;Venom Shot
$Gun_Label_2 = GuiCtrlCreateLabel( "Venom Shot", 30, 80, 90, 21)
$Gun_Shot_2 = GUICtrlCreateRadio("", 10, 80, 10, 20)

;Bane Shot
$Gun_Label_3 = GuiCtrlCreateLabel( "Bane Shot", 30, 100, 90, 21)
$Gun_Shot_3 = GUICtrlCreateRadio("", 10, 100, 10, 20)

;Hex Eater Shot
$Gun_Label_4 = GuiCtrlCreateLabel( "Hex Eater Shot", 30, 120, 90, 21)
$Gun_Shot_4 = GUICtrlCreateRadio("", 10, 120, 10, 20)

;Silver Shot
$Gun_Label_5 = GuiCtrlCreateLabel( "Silver Shot", 30, 140, 90, 21)
$Gun_Shot_5 = GUICtrlCreateRadio("", 10, 140, 10, 20)

;Steel Shot
$Gun_Label_6 = GuiCtrlCreateLabel( "Steel Shot", 30, 160, 90, 21)
$Gun_Shot_6 =  GUICtrlCreateRadio("", 10, 160, 10, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group


;Aimed Shot
GUICtrlCreateGroup("Aimed Shot", 5, 185, 175, 90)
$Gun_AimOn = GUICtrlCreateRadio("On", 45, 205, 50, 20)
$Gun_AimOff = GUICtrlCreateRadio("Off", 100, 205, 50, 20)

$Gun_Label_7 = GuiCtrlCreateLabel( "Aimed Shot Delay", 15, 225, 110, 21)
$Gun_Delay_1 = GuiCtrlCreateInput(Sqrt($guninfo[1][1]*$guninfo[1][1]), 125, 225, 50, 20)
$Gun_Button = GuiCtrlCreateButton("Update", 170, 330, 60, 20)


GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group



$dolltab = GuiCtrlCreateTabItem("Doll")

;Spell Menu
GUICtrlCreateGroup("Spell Menu", 5, 40, 250, 125)

;Poke 1
;Swarm 2
;Heal 3
;Curse4
;Scorch5
;Cure 6
;Grave Shackles7
;Life Drain8

;Poke
$Doll_Label_1 = GuiCtrlCreateLabel( "Poke", 50, 60, 50, 21)
$Doll_Spell_1 = GuiCtrlCreateCheckbox("1", 20, 60, 30, 20)

;Swarm
$Doll_Label_2 = GuiCtrlCreateLabel( "Swarm", 50, 80, 50, 21)
$Doll_Spell_2 = GuiCtrlCreateCheckbox("2", 20, 80, 30, 20)

;Heal
$Doll_Label_3 = GuiCtrlCreateLabel( "Heal", 50, 100, 50, 21)
$Doll_Spell_3 = GuiCtrlCreateCheckbox("3", 20, 100, 30, 20)

;Curse
$Doll_Label_4 = GuiCtrlCreateLabel( "Curse", 50, 120, 50, 21)
$Doll_Spell_4 = GuiCtrlCreateCheckbox("4", 20, 120, 30, 20)

;Scorch
$Doll_Label_5 = GuiCtrlCreateLabel( "Scorch", 140, 60, 90, 21)
$Doll_Spell_5 = GuiCtrlCreateCheckbox("5", 110, 60, 30, 20)

;Cure
$Doll_Label_6 = GuiCtrlCreateLabel( "Cure", 140, 80, 100, 21)
$Doll_Spell_6 = GuiCtrlCreateCheckbox("6", 110, 80, 30, 20)

;Grave Shackles
$Doll_Label_7 = GuiCtrlCreateLabel( "Grave Shackles", 140, 100, 100, 21)
$Doll_Spell_7 = GuiCtrlCreateCheckbox("7", 110, 100, 30, 20)

;Life Drain
$Doll_Label_8 = GuiCtrlCreateLabel( "Life Drain", 140, 120, 100, 21)
$Doll_Spell_8 = GuiCtrlCreateCheckbox("8", 110, 120, 30, 20)

;Delay
$Doll_Label_9 = GuiCtrlCreateLabel( "Spell Delay", 40, 140, 80, 21)
$Doll_Delay_1 = GuiCtrlCreateInput(Sqrt($dollinfo[3][1]*$dollinfo[3][1]), 140, 140, 50, 20)

GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group

$Doll_Button_1 = GuiCtrlCreateButton("Update", 170, 330, 60, 20)


$Daggertab = GuiCtrlCreateTabItem("Dagger")

;Combo Menu
GUICtrlCreateGroup("Combo Menu", 5, 40, 200, 105)

;Combo 1
$Dagger_Label_1 = GuiCtrlCreateLabel(  "Combo 1", 40, 60, 80, 21)
$Dagger_Combo_1 = GuiCtrlCreateInput( $daggerinfo[3][1], 130, 60, 50, 20)
$Dagger_Combo1 = GUICtrlCreateRadio("", 20, 60, 10, 20)

;Combo 2
$Dagger_Label_2 = GuiCtrlCreateLabel( "Combo 2", 40, 80, 80, 21)
$Dagger_Combo_2 = GuiCtrlCreateInput(sqrt($daggerinfo[4][1]*$daggerinfo[4][1]), 130, 80, 50, 20)
$Dagger_Combo2 = GUICtrlCreateRadio("", 20, 80, 10, 20)

;Combo 3
$Dagger_Label_3 = GuiCtrlCreateLabel( "Combo 3", 40, 100, 80, 21)
$Dagger_Combo_3 = GuiCtrlCreateInput(sqrt($daggerinfo[5][1]*$daggerinfo[5][1]), 130, 100, 50, 20)
$Dagger_Combo3 = GUICtrlCreateRadio("", 20, 100, 10, 20)

;Combo 4
$Dagger_Label_4 = GuiCtrlCreateLabel( "Combo 4", 40, 120, 80, 21)
$Dagger_Combo_4 = GuiCtrlCreateInput(sqrt($daggerinfo[6][1]*$daggerinfo[6][1]), 130, 120, 50, 20)
$Dagger_Combo4 = GUICtrlCreateRadio("", 20, 120, 10, 20)

GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group


;Special Group
GUICtrlCreateGroup("Specials to use", 5, 160, 150, 145)

;Asp
$Dagger_Label_7 = GuiCtrlCreateLabel( "Asp", 30, 180, 100, 21)
$Dagger_Combo7 = GuiCtrlCreateCheckbox("", 10, 180, 10, 20)
;Adder
$Dagger_Label_8 = GuiCtrlCreateLabel( "Adder", 30, 200, 90, 21)
$Dagger_Combo8 = GuiCtrlCreateCheckbox("", 10, 200, 10, 20)
;Dirt
$Dagger_Label_9 = GuiCtrlCreateLabel( "Dirt", 30, 220, 90, 21)
$Dagger_Combo9 = GuiCtrlCreateCheckbox("", 10, 220, 10, 20)
;Sidewinder
$Dagger_Label_10 = GuiCtrlCreateLabel( "Sidewinder", 30, 240, 90, 21)
$Dagger_Combo10 = GuiCtrlCreateCheckbox("", 10, 240, 10, 20)
;Viper's Nest
$Dagger_Label_11 = GuiCtrlCreateLabel( "Viper's Nest", 30, 260, 90, 21)
$Dagger_Combo11 = GuiCtrlCreateCheckbox("", 10, 260, 10, 20)
;Special Delay
$Dagger_Label_6 = GuiCtrlCreateLabel( "Special Delay", 30, 280, 90, 21)
$Dagger_Combo_6 = GuiCtrlCreateInput(sqrt($daggerinfo[2][1]*$daggerinfo[2][1]), 120, 280, 33, 20)
$Dagger_Combo6 = GuiCtrlCreateCheckbox("", 10, 280, 10, 20)

GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group

$Dagger_Button_1 = GuiCtrlCreateButton("Update", 170, 330, 60, 20)


$Grenadetab= GuiCtrlCreateTabItem("Grenade")

;Shot Menu
GUICtrlCreateGroup("Grenade Menu", 5, 40, 150, 155)

;Explosive
$Grenade_Label_1 = GuiCtrlCreateLabel( "Explosive", 50, 65, 100, 21)
$Grenade_1 = GUICtrlCreateRadio("", 30, 65, 10, 20)

;Stink Pot
$Grenade_Label_2 = GuiCtrlCreateLabel( "Stink Pot", 50, 85, 90, 21)
$Grenade_2 = GUICtrlCreateRadio("", 30, 85, 10, 20)

;Fire Bomb
$Grenade_Label_3 = GuiCtrlCreateLabel( "Fire Bomb", 50, 105, 90, 21)
$Grenade_3 = GUICtrlCreateRadio("", 30, 105, 10, 20)

;Smoke Bomb
$Grenade_Label_4 = GuiCtrlCreateLabel( "Hex Eater Shot", 50, 125, 90, 21)
$Grenade_4 = GUICtrlCreateRadio("", 30, 125, 10, 20)

;Slege Charge
$Grenade_Label_5 = GuiCtrlCreateLabel( "Slege Charge", 50, 145, 90, 21)
$Grenade_5 = GUICtrlCreateRadio("", 30, 145, 10, 20)

;Delay
$Grenade_Label_6 = GuiCtrlCreateLabel( "Throw Delay", 20, 170, 80, 21)
$Grenade_Delay_1 = GuiCtrlCreateInput( $grenadeinfo[3][1], 100, 170, 50, 20)


GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group

$Grenade_Button_1 = GuiCtrlCreateButton("Update", 170, 330, 60, 20)


$voodootab = GuiCtrlCreateTabItem("Voodoo Staff")

;Spell Menu
GUICtrlCreateGroup("Spell Menu", 5, 40, 250, 145)

;Soul Flay
$Staff_Label_1 = GuiCtrlCreateLabel( "Soul Flay", 40, 60, 70, 21)
$Staff_Delay_1 = GuiCtrlCreateInput(Sqrt($staffinfo[1][1]*$staffinfo[1][1]), 125, 60, 50, 20)
$Staff_Spell_1 = GUICtrlCreateRadio("", 15, 60, 10, 20)

;Pestilence
$Staff_Label_2 = GuiCtrlCreateLabel( "Pestilence", 40, 80, 70, 21)
$Staff_Delay_2 = GuiCtrlCreateInput(Sqrt($staffinfo[2][1]*$staffinfo[2][1]), 125, 80, 50, 20)
$Staff_Spell_2 = GUICtrlCreateRadio("", 15, 80, 10, 20)

;Wither
$Staff_Label_3 = GuiCtrlCreateLabel( "Wither", 40, 100, 50, 21)
$Staff_Delay_3 = GuiCtrlCreateInput(Sqrt($staffinfo[3][1]*$staffinfo[3][1]), 125, 100, 50, 20)
$Staff_Spell_3 = GUICtrlCreateRadio("", 15, 100, 10, 20)

;Flame Skull
$Staff_Label_4 = GuiCtrlCreateLabel( "Flame Skull", 40, 120, 70, 21)
$Staff_Delay_4 = GuiCtrlCreateInput(Sqrt($staffinfo[4][1]*$staffinfo[4][1]), 125, 120, 50, 20)
$Staff_Spell_4 = GUICtrlCreateRadio("", 15, 120, 10, 20)

;Banish
$Staff_Label_5 = GuiCtrlCreateLabel( "Banish", 40, 140, 70, 21)
$Staff_Delay_5 = GuiCtrlCreateInput(Sqrt($staffinfo[5][1]*$staffinfo[5][1]), 125, 140, 50, 20)
$Staff_Spell_5 = GUICtrlCreateRadio("", 15, 140, 10, 20)

;Desolation
$Staff_Label_6 = GuiCtrlCreateLabel( "Desolation", 40, 160, 70, 21)
$Staff_Delay_6 = GuiCtrlCreateInput(Sqrt($staffinfo[6][1]*$staffinfo[6][1]), 125, 160, 50, 20)
$Staff_Spell_6 = GUICtrlCreateRadio("", 15, 160, 10, 20)

$Staff_Button = GuiCtrlCreateButton("Update", 170, 330, 60, 20)


;Start of setup propoties function


GUICtrlCreateGroup("", -99, -99, 1, 1)  ;close group




;Event Driven Commands For buttons and Their Functions
;Button or Box is the first Variable, Function 2nd Variable

GUICtrlSetOnEvent($generalitem,"General")
;GUICtrlSetOnEvent($aboutitem,"Help")
GUICtrlSetOnEvent($Staff_Button,"Staff_Button")
GUICtrlSetOnEvent($Staff_Spell_1,"Staff_Spell1")
GUICtrlSetOnEvent($Staff_Spell_2,"Staff_Spell2")
GUICtrlSetOnEvent($Staff_Spell_3,"Staff_Spell3")
GUICtrlSetOnEvent($Staff_Spell_4,"Staff_Spell4")
GUICtrlSetOnEvent($Staff_Spell_5,"Staff_Spell5")
GUICtrlSetOnEvent($Staff_Spell_6,"Staff_Spell6")
GUICtrlSetOnEvent($Doll_Button_1,"Doll_Button")
GUICtrlSetOnEvent($Doll_Spell_1,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_2,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_3,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_4,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_5,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_6,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_7,"Doll_Spell")
GUICtrlSetOnEvent($Doll_Spell_8,"Doll_Spell")
GUICtrlSetOnEvent($Grenade_Button_1,"Grenade_Button")
GUICtrlSetOnEvent($Grenade_1,"Grenade1")
GUICtrlSetOnEvent($Grenade_2,"Grenade2")
GUICtrlSetOnEvent($Grenade_3,"Grenade3")
GUICtrlSetOnEvent($Grenade_4,"Grenade4")
GUICtrlSetOnEvent($Grenade_5,"Grenade5")
GUICtrlSetOnEvent($Gun_Button,"Gun_Button")
GUICtrlSetOnEvent($Gun_AimOff,"AimOff")
GUICtrlSetOnEvent($Gun_AimOn, "AimOn")
GUICtrlSetOnEvent($Gun_Shot_1,"Gun_Shot1")
GUICtrlSetOnEvent($Gun_Shot_2,"Gun_Shot2")
GUICtrlSetOnEvent($Gun_Shot_3,"Gun_Shot3")
GUICtrlSetOnEvent($Gun_Shot_4,"Gun_Shot4")
GUICtrlSetOnEvent($Gun_Shot_5,"Gun_Shot5")
GUICtrlSetOnEvent($Gun_Shot_6,"Gun_Shot6")
GUICtrlSetOnEvent($Dagger_Button_1,"Dagger_Button")
GUICtrlSetOnEvent($Dagger_Combo1,"Dagger_Combo1")
GUICtrlSetOnEvent($Dagger_Combo2,"Dagger_Combo2")
GUICtrlSetOnEvent($Dagger_Combo3,"Dagger_Combo3")
GUICtrlSetOnEvent($Dagger_Combo4,"Dagger_Combo4")
GUICtrlSetOnEvent($Dagger_Combo6,"Dagger_Combo6")
GUICtrlSetOnEvent($Dagger_Combo7,"Dagger_Special")
GUICtrlSetOnEvent($Dagger_Combo8,"Dagger_Special")
GUICtrlSetOnEvent($Dagger_Combo9,"Dagger_Special")
GUICtrlSetOnEvent($Dagger_Combo10,"Dagger_Special")
GUICtrlSetOnEvent($Dagger_Combo11,"Dagger_Special")
GUICtrlSetOnEvent($Cutlass_Button_1,"Cutlass_Button")
GUICtrlSetOnEvent($Cutlass_Combo1,"Cut_Combo1")
GUICtrlSetOnEvent($Cutlass_Combo2,"Cut_Combo2")
GUICtrlSetOnEvent($Cutlass_Combo3,"Cut_Combo3")
GUICtrlSetOnEvent($Cutlass_Combo4,"Cut_Combo4")
GUICtrlSetOnEvent($Cutlass_Combo5,"Cut_Combo5")
GUICtrlSetOnEvent($Cutlass_Special_1 ,"Cut_SpecialDelay")
GUICtrlSetOnEvent($Cutlass_Special_2,"Cutlass_Special")
GUICtrlSetOnEvent($Cutlass_Special_3,"Cutlass_Special")
GUICtrlSetOnEvent($Cutlass_Special_4,"Cutlass_Special")
GUICtrlSetOnEvent($Cutlass_Special_5,"Cutlass_Special")
GUISetOnEvent($GUI_EVENT_CLOSE,"OnExit")
GUICtrlSetOnEvent($exititem,"OnExit")


; Run the GUI until it is closed
GuiSetState()

update()

idle()

Func idle()

	Switch $activeWeapon
		Case 1
			HotKeySet("{F1}")
			Sleep($cutlassinfo[8][1])
			Send("{F1}")
			HotKeySet("{F1}", "cutlass")
		Case 2
			HotKeySet("{F2}")
			Sleep(500)
			Send("{F2}")
			HotKeySet("{F2}", "gun")
		Case 3
			HotKeySet("{F3}")
			Sleep($dollinfo[2][1])
			Send("{F3}")
			HotKeySet("{F3}", "doll")
		Case 4
			HotKeySet("{F4}")
			Sleep($daggerinfo[7][1])
			Send("{F4}")
			HotKeySet("{F4}", "dagger")
		Case 5
			HotKeySet("{F5}")
			Sleep(500)
			Send("{F5}")
			HotKeySet("{F5}", "grenade")
	EndSwitch
		
	$activeWeapon = 0
		
	While 1
		If (WinActive("Pirates")) Then
			$winpos = WinGetPos("Pirates")
			If ($healthinfo[1][1] = 1) Then
				$healthpix = PixelSearch(125 + $winpos[0],66 + $winpos[1],125 + $winpos[0], 66 + $winpos[1], 0, 5)
				if Not @error Then
					$tonicpix = PixelSearch(784 + $winpos[0],743 + $winpos[1],784 + $winpos[0], 743 + $winpos[1], 2498832, 38)
					if @error Then
						Send("t")
					EndIf
				EndIf
			EndIf
		EndIf
		Sleep(400)
	WEnd
EndFunc

Func  TogglePause()
    $Paused = NOT $Paused
	HotKeySet("{ENTER}")
	Send("{ENTER}")
	HotKeySet("{ENTER}", "TogglePause")
    While $Paused
        sleep(100)
    WEnd
EndFunc